﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sunny.Controls
{
	public static class Utility
	{
		//private static System.Globalization.CultureInfo _DateCulture;
		//public static System.Globalization.CultureInfo DateCulture
		//{
		//	get
		//	{
		//		if(_DateCulture== null)
		//		{
		//			_DateCulture = new System.Globalization.CultureInfo();
		//			_DateCulture.DateTimeFormat.LongDatePattern=
		//		}
		//	}
		//}

		//public static void SynchronizeCollection<T>(System.Collections.ObjectModel.ObservableCollection<T> source, System.Collections.IList target)
		//{
		//	source.CollectionChanged += (sender, e) =>
		//	{
		//		switch (e.Action)
		//		{
		//			case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
		//				foreach (object item in e.NewItems)
		//					target.Add(item);
		//				break;
		//			case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
		//				foreach (object item in e.OldItems)
		//					target.Remove(item);
		//				foreach (T item in e.NewItems)
		//					target.Insert(source.IndexOf(item), item);
		//				break;
		//			case System.Collections.Specialized.NotifyCollectionChangedAction.aaaaaaaaaRemove:
		//				foreach (object item in e.NewItems)
		//					target.Remove(item);
		//				break;
		//			case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
		//				for (int i = 0; i < e.NewItems.Count; i++)
		//					target[target.IndexOf(e.OldItems[i])] = e.NewItems[i];
		//				break;
		//			case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
		//				target.Clear();
		//				foreach (object item in source)
		//					target.Add(item);
		//				break;
		//		}
		//	};
		//}
	}
}